package com.zzl.study.auth.config;

import com.zzl.study.auth.redis.CommonRedisTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;

/**
 * @author: zhangzl
 * @date: 2024/3/11 16:14
 * @version: 1.0
 * @description: Redis配置类
 */
@Configuration
public class RedisConfig {

    /**
     * 向Spring容器中注入一个Common RedisTemplate
     *
     * @param factory Redis连接工厂
     * @return Common RedisTemplate
     */
    @Bean
    public CommonRedisTemplate commonRedisTemplate(RedisConnectionFactory factory) {
        return new CommonRedisTemplate(factory);
    }

}
